package demo7;

public class Test {
    public static void main(String[] args) {
        Rtundity rtundity = new Rtundity();
        Square square = new Square();
        Triangle triangle = new Triangle();

        Shape[] shape = {rtundity,square,rtundity,triangle,triangle,square};
        for(Shape shape1 : shape) {
            shape1.draw();
        }
    }
    public static void main1(String[] args) {
        Rtundity rtundity = new Rtundity();
        Square square = new Square();
        Triangle triangle = new Triangle();

        String[] shape = {"Rtundity","Square","Rtundity",
                          "Triangle","Triangle","Square"};
        for(String shape1 : shape) {
            if(shape1.equals("Rtundity")) {
                rtundity.draw();
            }else if (shape1.equals("Square")) {
                square.draw();
            }else {
                triangle.draw();
            }
        }
    }
}
